home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / comm / tcp / TCP_Start_Stop.lha / TCP_Start_Stop / bin / stopnet < prev   
Encoding:
AmigaDOS Script File  |  1997-11-10  |  925 b   |  47 lines

  1. .KEY FLUSH/S,KILL/S
  2. .BRA {
  3. .KET }
  4.  
  5. ; $VER: stopnet 1.9 (10.11.97) use with startnet 1.9 by jpvw@xs4all.nl
  6.  
  7. FailAt 21
  8.  
  9. ;--- kill servers and AmiPOP
  10. Break >NIL: `Status COM=aws:aws` C ; Send Break to aws
  11. Break >NIL: `Status COM=inetd` C ; Send Break to inetd
  12. Break >NIL: `Status COM=AmiPOP` C ; Send Break to AmiPOP
  13.  
  14. ; hangup
  15. ifconfig ppp0 down
  16. offline ppp0
  17.  
  18. ; Kill TCP/IP stack or delete routes only
  19. If {KILL}
  20.   rx "address AMITCP; KILL" ; Send "KILL" to AmiTCP
  21.   Assign >NIL: TCP: DISMOUNT
  22.   If {FLUSH}
  23.     Wait 2 secs
  24.     If `rx "Say Show(ports, AMITCP)"` EQ 0
  25.       Avail >NIL: FLUSH
  26.     EndIf
  27.   EndIf
  28. Else
  29.   If "$ppp0IPLocal" NOT EQ "*$ppp0IPLocal"
  30.     route >NIL: delete $ppp0IPLocal localhost
  31.     route >NIL: delete default $ppp0IPRemote
  32.   EndIf
  33.   ifconfig lo0 down
  34.   If {FLUSH}
  35.     Echo "FLUSH only when KILLed"
  36.   EndIf
  37. EndIf
  38.  
  39. ; cleanup
  40. UnsetEnv ppp0IPLocal
  41. UnsetEnv ppp0IPRemote
  42. UnsetEnv HOSTNAME
  43.  
  44. Lab Exit
  45. FailAt 10
  46.  
  47.